--- categories: Data structures --- ## Problems - [Count on a tree](http://www.spoj.com/problems/COT/) - [K-th Number](http://www.spoj.com/problems/MKTHNUM/) - [Sorting](https://www.codechef.com/problems/SORTING) - [Observing the Tree](https://www.codechef.com/problems/QUERY) - [Noble Knight's Path](http://codeforces.com/problemset/problem/226/E) - [K-Query Online](http://www.spoj.com/problems/KQUERYO/) [^1] - [Persistent Queue](http://codeforces.com/gym/100431) - [Pork Barrel](https://open.kattis.com/problems/porkbarrel) ## See also - [Segment tree]() - [Persistent data structure]() ## External links - [Persistent segment trees – Explained with spoj problems](https://blog.anudeep2011.com/persistent-segment-trees-explained-with-spoj-problems/) - [Algorithm Gym :: Everything About Segment Trees](http://codeforces.com/blog/entry/15890) - [Persistent Segment Trees HKU](https://i.cs.hku.hk/~provinci/training2016/notes4.pdf) [^1]: Note that the test cases are a little bit shady, sometimes giving queries $i,j$ that don't satisfy $1\leq i\leq j\leq n$. **Blue.Mary** describes the correct behaviour in the comments.